package idiet.service;

import idiet.bean.CustomerNurse;
import idiet.bean.CustomerNurseMeal;
import idiet.dao.hibernate.CustomerNurseMealDao;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

@Repository("customerNurseMealService")
public class CustomerNurseMealService {
	@Autowired
	CustomerNurseMealDao customerNurseMealDao;
	public CustomerNurseMeal getCustomerNurse(int customerNurseMealId){
		return this.customerNurseMealDao.getCustomerNurseMealById(customerNurseMealId);
	}
	public List<CustomerNurseMeal> getCustomerNurseMeals(){
		return this.customerNurseMealDao.getCustomerNurseMeals();
	}
	public List<CustomerNurseMeal> getCustomerNurseMeals(String mealName){
		if(mealName==null){
			return this.customerNurseMealDao.getCustomerNurseMeals();
		}else{
			return this.customerNurseMealDao.getCustomerNurseMealsByCustomerNurseMealName(mealName);
		}
	}
	public List<CustomerNurseMeal> getCustomerNurseMeals(CustomerNurse nurse){
		return this.customerNurseMealDao.getCustomerNurseMealsByCustomerNurse(nurse);
	}
	public void createCustomerNurseMeal(CustomerNurseMeal customerNurseMeal){
		this.customerNurseMealDao.createCustomerNurseMeal(customerNurseMeal);
	}
	public void updateCustomerNurseMeal(CustomerNurseMeal customerNurseMeal){
		this.customerNurseMealDao.updateCustomerNurseMeal(customerNurseMeal);
	}
	public void deleteCustomerNurseMeal(CustomerNurseMeal customerNurseMeal){
		this.customerNurseMealDao.deleteCustomerNurseMeal(customerNurseMeal);
	}
}
